package com.example.demo.service.impl;


import java.util.List;

import com.example.demo.dao.UserAndRoleDao;
import com.example.demo.entity.UserAndRole;
import com.example.demo.mapper.UserAndRoleMapper;
import com.example.demo.service.UserAndRoleService;

/**
 * @author Henry.Y
 * @date 2019-05-27
 */
public class UserAndRoleServiceImpl implements UserAndRoleService{
	
	private UserAndRoleMapper userAndRoleDao= new UserAndRoleDao();

    public int createUserAndRole(UserAndRole userAndRole){
    	String sqlId="com.example.demo.entity.UserAndRole.insertUserAndRole";
    	return userAndRoleDao.createUserAndRole(sqlId, userAndRole);
    }
	
	public int deleteUserAndRole(String id){
		String sqlId="com.example.demo.entity.UserAndRole.deleteUserAndRole";
		return userAndRoleDao.deleteUserAndRole(sqlId, id);
	}
	
	
	public UserAndRole selectOneUserAndRole(UserAndRole userAndRole){
		
		String sqlId="com.example.demo.entity.UserAndRole.selectOneSelectUserAndRole";
		return userAndRoleDao.selectOneUserAndRole(sqlId, userAndRole);
	}

	public List<UserAndRole> selectUserAndRole(){
		String sqlId="com.example.demo.entity.UserAndRole.selectSelectUserAndRole";
		return userAndRoleDao.selectUserAndRole(sqlId);
	}
	
	public int deleteUserAndRoleTable(){
		String sqlId="com.example.demo.entity.UserAndRole.deleteUserAndRoleTable";
		return userAndRoleDao.deleteUserAndRoleTable(sqlId);
	}
}
